package Date;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class DateDemo {
	public static void main(String[] args) throws ParseException  {
//		method1();
		Calendar c = Calendar.getInstance();
//		c.set(Calendar.DAY_OF_MONTH, 20);
		c.add(Calendar.DAY_OF_MONTH, 2);
		int year = c.get(Calendar.YEAR);
		int month = c.get(Calendar.MONTH);
		int day = c.get(Calendar.DAY_OF_MONTH);
		
		
		System.out.println(year + "年" + month+"月"+day+"日");
		
		
	}

	private static void method1() throws ParseException {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
		Date date = new Date();
		String s = sdf.format(date);
		System.out.println(s);
		
		Date d = sdf.parse("2021年04月22日");
		System.out.println(d.toLocaleString());
	}
}
